﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace System.CJL.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class 添加成品入库表 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "FinishedProducts",
                columns: table => new
                {
                    finishedProductId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    finishedProductNumbering = table.Column<string>(type: "text", nullable: true),
                    finishedProductName = table.Column<string>(type: "text", nullable: true),
                    finishedProductModel = table.Column<string>(type: "text", nullable: true),
                    finishedProductUnit = table.Column<string>(type: "text", nullable: true),
                    finishedProductUpperLimit = table.Column<int>(type: "integer", nullable: false),
                    finishedProductDays = table.Column<int>(type: "integer", nullable: false),
                    finishedProductBatch = table.Column<int>(type: "integer", nullable: false),
                    finishedProductLowerLimit = table.Column<int>(type: "integer", nullable: false),
                    finishedProductState = table.Column<int>(type: "integer", nullable: false),
                    finishedProductRemark = table.Column<string>(type: "text", nullable: true),
                    finishedProductImg = table.Column<string>(type: "text", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FinishedProducts", x => x.finishedProductId);
                });

            migrationBuilder.CreateTable(
                name: "Storages",
                columns: table => new
                {
                    StorageId = table.Column<int>(type: "integer", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    StorageName = table.Column<string>(type: "text", nullable: true),
                    StorageNumbering = table.Column<string>(type: "text", nullable: true),
                    StorageDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    StorageRemark = table.Column<string>(type: "text", nullable: true),
                    DetailsName = table.Column<string>(type: "text", nullable: true),
                    DetailsNumbering = table.Column<string>(type: "text", nullable: true),
                    DetailsSpec = table.Column<string>(type: "text", nullable: true),
                    DetailsUnit = table.Column<string>(type: "text", nullable: true),
                    DetailsNumber = table.Column<string>(type: "text", nullable: true),
                    DetailsNum = table.Column<int>(type: "integer", nullable: false),
                    WarehouseName = table.Column<string>(type: "text", nullable: true),
                    DetailsDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    WarehouseHead = table.Column<string>(type: "text", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Storages", x => x.StorageId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "FinishedProducts");

            migrationBuilder.DropTable(
                name: "Storages");
        }
    }
}
